﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;
using System.Collections.ObjectModel;

namespace SmartPaginator.Elements
{
    public class SectionElement: BlockContainerElement
    {
        #region Constructor

        protected SectionElement(Section source):base(source)
        {
            // For our usage scenarios, we will always breake pages when we get a new section
            this.BreakPageBefore = true;
            this.Background = source.Background;
        }

        public SectionElement(Section source, IElementFactory factory): base(source, source.Blocks, factory)
        {
            // For our usage scenarios, we will always breake pages when we get a new section
            this.BreakPageBefore = true;
            this.Background = source.Background;
        }

        #endregion

        #region Properties

        public Section Section { get { return Source as Section; } }

        #endregion

        #region GetEmptyCopy Method

        public override IBlockElement GetEmptyCopy()
        {
            var result = new SectionElement(this.Section);
            return result;
        }

        #endregion
    }
}
